package com.qzsoft.zhjd.common.utils;

import com.qzsoft.jeemis.common.exception.RenException;

import com.qzsoft.zhjd.common.enums.BizCode;

/**
 * @ClassName RenExceptionUtils
 * @Description 异常工具类
 * @author linhuawei
 * @since 2021-09-16
 */
public class RenExceptionUtils {
    
    public static void throwEx() {
        RenException ex = new RenException(BizCode.EXCEPTION.getMessage());
        ex.setCode(BizCode.EXCEPTION.getCode());
        throw ex;
    }
    
    public static void throwEx(String message) {
        RenException ex = new RenException(message);
        ex.setCode(BizCode.EXCEPTION.getCode());
        throw ex;
    }
    
    public static void throwEx(BizCode bizCode) {
        RenException ex = new RenException(bizCode.getMessage());
        ex.setCode(bizCode.getCode());
        throw ex;
    }
    
    public static void throwEx(BizCode bizCode, String message) {
        RenException ex = new RenException(message);
        ex.setCode(bizCode.getCode());
        throw ex;
    }

}
